package org.tloss.web.editor.utils;

import java.util.List;

import org.tloss.web.editor.model.oper.math.MathOperand;

public abstract class VariableGroup implements Variable {
	private String name;
	private List<Variable> variables;
	private Variable parent;

	public VariableGroup(String name) {
		this.name = name;
	}

	public String toString() {

		return "[" + name + "]";
	}

	@Override
	public List<Variable> getChildren() {
		return variables;
	}

	@Override
	public Variable getParent() {
		return parent;
	}

	@Override
	public void setParent(Variable parent) {
		this.parent = parent;
	}

	@Override
	public boolean hasChildren() {
		return variables != null && !variables.isEmpty();
	}

	@Override
	public void setChildren(List<Variable> variables) {
		this.variables = variables;

	}

	public abstract boolean supportedVairable(Variable variable);

	public MathOperand convertToMathOperand() {
		return null;
	}
}